package lg.minecraft.plugin.library.command;

import lombok.Getter;

/**
 * @author langle__
 * @version 1.0
 */
@Getter
public abstract class SubCommand extends BaseCommand {

    private LGCommand parentCommand;

    public SubCommand(String name) {
        super(name);
    }

    public boolean canRegister() {
        return true;
    }

    public SubCommand(String name, String... aliases) {
        super(name, aliases);
    }

    public String getDescription() {
        return "";
    }

    public void setParentCommand(LGCommand parentCommand) {
        if (this.parentCommand != null) {
            return;
        }
        this.parentCommand = parentCommand;
    }

    public void unregister() {
        parentCommand.unregisterSubCommand(this);
    }

}
